HARPA.AI
LIBRARYAPIGUIDESAI COMMANDSBLOG

๐Ÿค–ย ย Custom Deep Research Bot | v1.0

Performs an in-depth online research to answer user queries. Split questions into sub-queries for deeper scans.

Created by Morteza H.
Updated on Apr 9, 05:28
Installed 23 times
RUNS JS CODE

How to Use

IMPORT COMMAND

Content

- type: say
  message: >-
    **Tip:** This command performs a thorough in-depth online search for a given
    query or topic and is best used for research. It takes time and is token
    hungry (~20k tokens on GPT-4o-mini per search depth).
  label: TIP COMMAND
- param: userQuery
  message: '![icon](/img/commands/general-search-refraction.svg) Type your search query:'
  type: ask
  options: null
  default: ''
  label: USER QUERY
- param: depth
  message: >-
    **Set the search depth.**


    Search depth indicates how many search pages will be analyzed. Each depth
    level generates an extra sub-query, improving search quality.
  options:
    - label: ๐Ÿ” SEARCH
      value: 1
    - label: 2 SUB-QUERIES
      value: 2
    - label: 3 SUB-QUERIES
      value: 3
    - label: 4 SUB-QUERIES
      value: 4
  optionsInvalid: false
  type: ask
  default: ''
  label: DEPTH
- steps:
    - prompt: >-
        # Prompt: Broad Coverage Multiple Google Search Queries Generator


        You are an expert Google Search Strategist. Your specialty is dissecting
        a user's information need and constructing **multiple broad, yet
        relevant** Google search queries using advanced syntax to maximize
        coverage of potential results.


        OUTPUT LANGUAGE: Respond **only** in the language of the **LANGUAGE
        BASED ON USER INPUT**.


        TASK:

        Analyze the **USER INPUT** (topic, question, or keywords) to understand
        the core information need. Generate **{{depth}} different** Google
        search queries optimized for **maximum relevant coverage and result
        count**.


        Key Techniques & Context for Maximizing Results:

        Leverage Google's advanced search operators strategically, focusing on
        breadth:

        -   `OR`: Use extensively to include synonyms, related concepts, or
        alternative phrasings for core keywords. This is the primary tool for
        broadening the search.

        -   `( )`: Use to group `OR` statements or structure complex queries
        logically, ensuring correct operator precedence. Example: `(keywordA OR
        keywordB) AND (topicX OR topicY)`.

        -   `" "` (Single Crucial Word ONLY):** Apply quotation marks **only**
        if there is **one single keyword** that is absolutely *crucial* and must
        appear exactly as typed (e.g., to distinguish it from homonyms or ensure
        its presence). **Do NOT use `" "` for phrases or multiple words.** If no
        single word is that critical, do not use `" "`.

        -   Core Keywords: Identify the essential concepts but consider broader
        terms or related ideas.

        -   `AND`: Note that Google implies `AND` between terms by default.
        Explicitly writing `AND` is usually unnecessary and does not broaden the
        search compared to just listing terms. Focus on `OR` for expansion.

        -   Other Operators (`site:`, `-`, `*`, `intitle:`, `filetype:`):** Use
        these sparingly and only if they directly support the goal of broad,
        relevant coverage without unduly restricting results (e.g., `site:`
        could be used with `OR` across multiple relevant sites, `-` could
        exclude a major *irrelevant* topic).


        Inferential Capability & Query Selection:

        -   Keywords/Phrases: Extract core concepts. Brainstorm synonyms and
        related terms suitable for `OR` combinations.

        -   Crucial Word Identification: Determine if *one single word* meets
        the strict criteria for using `" "`. If not, omit `" "`.

        -   Structure: Construct multiple queries prioritizing broad keyword
        inclusion via `OR` and logical grouping with `( )`. Balance breadth with
        maintaining relevance to the user's core need.


        OUTPUT FORMAT:

        Present your response as a JSON array with {{depth}} objects, each
        containing a "query" field with an optimized search query. Do not
        include any labels, explanations, introductory/concluding remarks, or
        any text other than the JSON array.


        Example JSON response:


        [
          {
            "query": "(eco-friendly OR sustainable OR green OR biodegradable) (packaging OR containers OR wrapping) (alternatives OR options OR solutions) (small business OR SME OR startup OR entrepreneur)"
          },
          {
            "query": "(cardboard OR paper OR bamboo OR hemp OR mushroom OR seaweed) packaging (small business OR retail OR SME) (sustainable OR eco-friendly)"
          },
          {
            "query": "(affordable OR budget OR cost-effective) (eco-friendly OR sustainable) packaging (implementation OR transition OR switch) (small business OR SME OR startup)"
          },
          {
            "query": "(suppliers OR vendors OR manufacturers OR brands) (eco-friendly OR green OR sustainable) packaging (small business OR SME OR local business)"
          }
        ]


        CONSTRAINTS:

        -   Generate exactly {{depth}} optimized query strings designed for
        maximum relevant results.

        -   Each query should focus on a different aspect or approach to the
        user's question.

        -   Prioritize the use of `OR` and `( )` for breadth.

        -   Use `" "` **only** around single, critical keywords if absolutely
        necessary, never for phrases.

        -   Output **only** the JSON array containing the queries.

        -   Ensure the generated queries are immediately copy-paste usable in
        Google.

        -   Adhere strictly to the specified output language (based on USER
        INPUT).


        BEGIN USER INPUT:

        {{userQuery}}
      param: subqueries
      condition: '{{depth}} > 1'
      type: gpt
      silent: true
      label: BROAD COVERAGE MULTIPLE GOOGLE SEARCH QUERIES GENERATOR
    - type: calc
      func: extract-json
      to: subqueries
      param: subqueries
      index: ''
      label: EXTRACT SUBQUERIES JSON
    - message: >-
        ๐Ÿงฉ To give a comprehensive response, your question was split into
        **{{subqueries.length}}** sub-queries.
      type: say
      label: SUBQUERIES LENGTH
    - steps:
        - value: '{{item.query}}'
          func: set
          param: query
          format: text
          type: calc
        - message: 'โณ Scanning information for sub-query: "**{{query}}**".'
          type: say
        - param: information
          value: '{{serp {{query}}}}'
          type: calc
          func: set
          format: ''
        - func: serp.extract-links
          to: links
          type: calc
          from: information
        - param: total
          value: '{{links.length}}'
          format: number
          type: calc
          func: set
        - steps:
            - value: '{{page {{item.url}}}}'
              param: content
              type: calc
              func: set
              format: ''
            - type: js
              code: |-
                const content = args['content']; 
                return { 
                 chars: content.length, 
                 estimatedTokens: Math.ceil(content.length / 4), 
                 estimatedWords: Math.ceil(content.length / 4 * 0.75) 
                };
              param: count
              timeout: 15000
              onFailure: SAY STATUS
              label: COUNT
              args: content
              silent: true
            - param: pageUrl
              value: '{{item.url}}'
              type: calc
              func: set
              format: text
            - code: |-
                const regex = /^(?:https?:\/\/)?(?:www\.)?([^\/]+)/;
                const testString = pageUrl;
                const matches = testString.match(regex);

                if (matches) {
                  const hostname = matches[1];
                  return hostname; 
                }
              param: hostname
              label: HOSTNAME
              type: js
              args: pageUrl
              timeout: 15000
              silent: true
            - func: increment
              param: index
              type: calc
              delta: 1
            - args: index, total
              code: |-
                function calculatePercentage(index, total) {
                    index = Number(index);
                    total = Number(total);

                    if (isNaN(index) || isNaN(total)) {
                        return "Error";
                    }

                    return (index / total * 100).toFixed(1) + "%";
                }

                let result = calculatePercentage(index, total);
                return result;
              param: percentage
              label: PERCENTAGE INDEX TOTAL
              type: js
              timeout: 15000
              silent: true
            - type: group
              steps:
                - steps:
                    - prompt: >-
                        Act as a professional researcher. 


                        Analyze the given [web page content] and summarize
                        useful information to answer my query: "{{query}}"


                        Instructions:

                        - Imagine you are a Google Search engine, collecting
                        relevant information from various websites to form an
                        answer to my query in {{language}}.

                        - Focus on providing detailed factual information,
                        statistics, and specific examples when available.

                        - Gather all information that will be useful in
                        answering my question, including context, numbers, dates
                        and concrete details.

                        - Extract as much useful information as possible from
                        the page content.

                        - Avoid general phrases.

                        - When referring to someone's opinion about something,
                        mention the author. Quote if appropriate.

                        - If you haven't found anything useful, don't make up
                        information or guess - simply say "No relevant
                        information found" in {{language}}.

                        - Do not echo my prompt in your response.

                        - Respond with a JSON object containing a single field:
                        "info".

                        - Write nothing other than the JSON.


                        Example JSON response:


                        {
                          "info": "Write here textual information that would help answer my query. Write as much as you think is necessary, focusing on providing useful information for further processing."
                        }



                        [Web page content]: {{content}}.



                        JSON response:
                      param: data
                      type: gpt
                      isolated: true
                      silent: true
                    - index: first
                      type: calc
                      func: extract-json
                      to: data
                      param: data
                    - param: data.url
                      format: auto
                      type: calc
                      func: set
                      value: '{{item.url}}'
                    - param: data.title
                      value: '{{item.title}}'
                      type: calc
                      func: set
                      format: auto
                    - list: array
                      func: list-add
                      index: last
                      type: calc
                      item: data
                    - type: jump
                      to: SAY STATUS
                  condition: '{{content}} =~ ^[\s\S]{1000,}$'
                  label: FETCHED
                  type: group
              condition: >-
                {{hostname}} =~
                ^(?!.*(reddit\.com|redd\.it)).*(?:https?:\/\/|www\.)?[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}.*$
              label: IS IT REDDIT?
            - steps:
                - args: item.url
                  code: >-
                    // Get URL from args parameter

                    const url = args['item.url'];


                    if (!url) {
                      return false;
                    }


                    const fullUrl = url.startsWith('http') ? url : 'https://' +
                    url;


                    window.location.href = fullUrl;

                    return true;
                  param: navigate.boolean
                  onFailure: ABORT NAVIGATE
                  label: NAVIGATE
                  type: js
                  timeout: 15000
                  silent: true
                - type: wait
                  for: custom-delay
                  delay: '1500'
                  silent: true
                  label: ABORT NAVIGATE
                - steps:
                    - param: setThread
                      value: '{{thread}}'
                      type: calc
                      func: set
                      format: ''
                    - code: |-
                        // For setThread
                        const text = args['setThread'];
                        const tokenCount = Math.ceil(text.length / 4);

                        return {
                          chars: text.length,
                          estimatedTokens: tokenCount,
                          estimatedWords: Math.ceil(tokenCount * 0.75)
                        };
                      onFailure: SOCIAL-MEDIA PROMPT
                      type: js
                      args: setThread
                      param: count
                      timeout: 15000
                      silent: true
                      label: COUNT
                    - prompt: >-
                        Act as a professional researcher. 


                        Analyze the given [web page content] and summarize
                        useful information to answer my query: "{{query}}"


                        Instructions:

                        - Imagine you are a Google Search engine, collecting
                        relevant information from various websites to form an
                        answer to my query in {{language}}.

                        - Focus on providing detailed factual information,
                        statistics, and specific examples when available.

                        - Gather all information that will be useful in
                        answering my question, including context, numbers, dates
                        and concrete details.

                        - Extract as much useful information as possible from
                        the page content.

                        - Avoid general phrases.

                        - When referring to someone's opinion about something,
                        mention the author. Quote if appropriate.

                        - If you haven't found anything useful, don't make up
                        information or guess - simply say "No relevant
                        information found" in {{language}}.

                        - Do not echo my prompt in your response.

                        - Respond with a JSON object containing a single field:
                        "info".

                        - Write nothing other than the JSON.


                        Example JSON response:


                        {
                          "info": "Write here textual information that would help answer my query. Write as much as you think is necessary, focusing on providing useful information for further processing."
                        }



                        [Web page content]: {{setThread}}.



                        JSON response:
                      type: gpt
                      isolated: true
                      param: data
                      silent: true
                      label: SOCIAL-MEDIA PROMPT
                  label: SOCIAL-MEDIA
                  condition: >-
                    {{hostname}} =~
                    ^(?:reddit|facebook|twitter|telegram|discord|whatsapp)\.com$
                  type: group
                - steps:
                    - param: setPageThread
                      value: '{{page}} {{thread}}'
                      type: calc
                      func: set
                      format: ''
                    - code: |-
                        // For setPageThread
                        const text = args['setPageThread'];
                        const tokenCount = Math.ceil(text.length / 4);

                        return {
                         chars: text.length,
                         estimatedTokens: tokenCount,
                         estimatedWords: Math.ceil(tokenCount * 0.75)
                        };
                      onFailure: NOT-SOCIAL-MEDIA PROMPT
                      type: js
                      args: setPageThread
                      param: count
                      timeout: 15000
                      silent: true
                      label: COUNT
                    - prompt: >-
                        Act as a professional researcher. 


                        Analyze the given [web page content] and summarize
                        useful information to answer my query: "{{query}}"


                        Instructions:

                        - Imagine you are a Google Search engine, collecting
                        relevant information from various websites to form an
                        answer to my query in {{language}}.

                        - Focus on providing detailed factual information,
                        statistics, and specific examples when available.

                        - Gather all information that will be useful in
                        answering my question, including context, numbers, dates
                        and concrete details.

                        - Extract as much useful information as possible from
                        the page content.

                        - Avoid general phrases.

                        - When referring to someone's opinion about something,
                        mention the author. Quote if appropriate.

                        - If you haven't found anything useful, don't make up
                        information or guess - simply say "No relevant
                        information found" in {{language}}.

                        - Do not echo my prompt in your response.

                        - Respond with a JSON object containing a single field:
                        "info".

                        - Write nothing other than the JSON.


                        Example JSON response:


                        {
                          "info": "Write here textual information that would help answer my query. Write as much as you think is necessary, focusing on providing useful information for further processing."
                        }



                        [Web page content]: {{setPageThread}}.



                        JSON response:
                      type: gpt
                      isolated: true
                      param: data
                      silent: true
                      label: NOT-SOCIAL-MEDIA PROMPT
                  condition: >-
                    {{hostname}} =~
                    ^(?!(?:reddit|facebook|twitter|telegram|discord|whatsapp)\.com)[a-zA-Z0-9-]+\.[a-zA-Z]+$
                  label: NOT-SOCIAL-MEDIA
                  type: group
                - type: calc
                  func: extract-json
                  to: data
                  param: data
                  index: first
                - type: calc
                  func: set
                  param: data.url
                  format: auto
                  value: '{{item.url}}'
                - type: calc
                  func: set
                  param: data.title
                  format: auto
                  value: '{{item.title}}'
                - type: calc
                  func: list-add
                  index: last
                  list: array
                  item: data
              label: NOT FETCHED
              type: group
            - message: >-
                ๐Ÿ” Analyzed **{{index}} / {{total}}**, 
                [{{hostname}}]({{pageUrl}})

                - Chars: {{count.chars}}

                - Estimated Tokens: {{count.estimatedTokens}}

                - Estimated Words: {{count.estimatedWords}}
              label: โ›”๏ธSAY STATUS
              condition: '{{index}} = {{total1}}'
              type: say
            - message: |-
                ๐Ÿ” Analyzed **{{percentage}}**,  [{{hostname}}]({{pageUrl}})
                - Chars: {{count.chars}}
                - Estimated Tokens: {{count.estimatedTokens}}
                - Estimated Words: {{count.estimatedWords}}
              condition: '{{index}} != {{total}}'
              type: say
              label: SAY STATUS
            - code: |-
                const content = args['array'];
                const stringContent = JSON.stringify(content);

                return {
                  chars: stringContent.length,
                  estimatedTokens: Math.ceil(stringContent.length / 4),
                  estimatedWords: Math.ceil(stringContent.length / 4 * 0.75)
                };
              param: arrayLength
              label: ARRAY LENGTH
              type: js
              args: array
              timeout: 15000
              onFailure: SAY STATUS
              silent: true
            - message: |-
                โœ… **{{percentage}}** pages scanned for "**{{query}}**". 

                Last checked page: [{{hostname}}]({{pageUrl}})
                - Chars: {{count.chars}}
                - Estimated Tokens: {{count.estimatedTokens}}
                - Estimated Words: {{count.estimatedWords}}
                - Array Token length: **{{arrayLength.estimatedTokens}}**
              condition: '{{index}} = {{total}}'
              type: say
              label: SAY STATUS
          type: loop
          list: links
      type: loop
      list: subqueries
    - message: >-
        ๐Ÿค– Analyzed **{{array.length}}** pages from **{{subqueries.length}}**
        Google searches. 

        Now preparing a comprehensive answer to your question.
      type: say
  label: DEPTH > 1
  type: group
  condition: '{{depth}} > 1'
- steps:
    - message: โณ Give me a minute to search through the web for you...
      type: say
    - value: '{{userQuery}}'
      type: calc
      func: set
      param: query
      format: text
    - type: calc
      func: set
      param: information
      format: ''
      value: '{{serp {{query}}}}'
    - type: calc
      func: serp.extract-links
      from: information
      to: links
    - type: calc
      func: set
      param: total
      format: number
      value: '{{links.length}}'
    - steps:
        - label: TRYING TO FETCH
          type: calc
          func: set
          param: content
          format: ''
          value: '{{page {{item.url}}}}'
        - onFailure: FAILED COUNT
          type: js
          args: content
          code: |-
            const content = args['content']; 
            return { 
             chars: content.length, 
             estimatedTokens: Math.ceil(content.length / 4), 
             estimatedWords: Math.ceil(content.length / 4 * 0.75) 
            };
          param: count
          timeout: 15000
          label: COUNT
          silent: true
        - type: calc
          func: set
          param: pageUrl
          format: text
          value: '{{item.url}}'
          label: FAILED COUNT
        - type: js
          args: pageUrl
          code: |-
            const regex = /^(?:https?:\/\/)?(?:www\.)?([^\/]+)/;
            const testString = pageUrl;
            const matches = testString.match(regex);

            if (matches) {
              const hostname = matches[1];
              return hostname; 
            }
          param: hostname
          timeout: 15000
          silent: true
          label: HOSTNAME
        - type: calc
          func: increment
          param: index
          delta: 1
        - type: js
          args: index, total
          code: |-
            function calculatePercentage(index, total) {
                index = Number(index);
                total = Number(total);

                if (isNaN(index) || isNaN(total)) {
                    return "Error";
                }

                return (index / total * 100).toFixed(1) + "%";
            }

            let result = calculatePercentage(index, total);
            return result;
          param: percentage
          timeout: 15000
          silent: true
          label: PERCENTAGE INDEX TOTAL
        - type: group
          steps:
            - steps:
                - type: gpt
                  prompt: >-
                    Act as a professional researcher. 


                    Analyze the given [web page content] and summarize useful
                    information to answer my query: "{{query}}"


                    Instructions:

                    - Imagine you are a Google Search engine, collecting
                    relevant information from various websites to form an answer
                    to my query in {{language}}.

                    - Focus on providing detailed factual information,
                    statistics, and specific examples when available.

                    - Gather all information that will be useful in answering my
                    question, including context, numbers, dates and concrete
                    details.

                    - Extract as much useful information as possible from the
                    page content.

                    - Avoid general phrases.

                    - When referring to someone's opinion about something,
                    mention the author. Quote if appropriate.

                    - If you haven't found anything useful, don't make up
                    information or guess - simply say "No relevant information
                    found" in {{language}}.

                    - Do not echo my prompt in your response.

                    - Respond with a JSON object containing a single field:
                    "info".

                    - Write nothing other than the JSON.


                    Example JSON response:


                    {
                      "info": "Write here textual information that would help answer my query. Write as much as you think is necessary, focusing on providing useful information for further processing."
                    }



                    [Web page content]: {{content}}.



                    JSON response:
                  isolated: true
                  param: data
                  silent: true
                - type: calc
                  func: extract-json
                  to: data
                  param: data
                  index: first
                - type: calc
                  func: set
                  param: data.url
                  format: auto
                  value: '{{item.url}}'
                - type: calc
                  func: set
                  param: data.title
                  format: auto
                  value: '{{item.title}}'
                - type: calc
                  func: list-add
                  index: last
                  list: array
                  item: data
                - type: jump
                  to: SAY STATUS
              condition: '{{content}} =~ ^[\s\S]{1000,}$'
              type: group
              label: FETCHED
          condition: >-
            {{hostname}} =~
            ^(?!.*(reddit\.com|redd\.it)).*(?:https?:\/\/|www\.)?[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}.*$
          label: IS IT REDDIT?
        - steps:
            - type: js
              args: item.url
              code: |-
                // Get URL from args parameter
                const url = args['item.url'];

                if (!url) {
                  return false;
                }

                const fullUrl = url.startsWith('http') ? url : 'https://' + url;

                window.location.href = fullUrl;
                return true;
              param: navigate.boolean
              timeout: 15000
              onFailure: ABORT NAVIGATE
              label: NAVIGATE
              silent: true
            - type: wait
              for: custom-delay
              silent: true
              label: ABORT NAVIGATE
              delay: '1500'
            - steps:
                - type: calc
                  func: set
                  param: setThread
                  format: ''
                  value: '{{thread}}'
                - type: js
                  args: setThread
                  code: |-
                    // For setThread
                    const text = args['setThread'];
                    const tokenCount = Math.ceil(text.length / 4);

                    return {
                      chars: text.length,
                      estimatedTokens: tokenCount,
                      estimatedWords: Math.ceil(tokenCount * 0.75)
                    };
                  param: count
                  timeout: 15000
                  onFailure: SOCIAL-MEDIA PROMPT
                  label: COUNT
                  silent: true
                - type: gpt
                  prompt: >-
                    Act as a professional researcher. 


                    Analyze the given [web page content] and summarize useful
                    information to answer my query: "{{query}}"


                    Instructions:

                    - Imagine you are a Google Search engine, collecting
                    relevant information from various websites to form an answer
                    to my query in {{language}}.

                    - Focus on providing detailed factual information,
                    statistics, and specific examples when available.

                    - Gather all information that will be useful in answering my
                    question, including context, numbers, dates and concrete
                    details.

                    - Extract as much useful information as possible from the
                    page content.

                    - Avoid general phrases.

                    - When referring to someone's opinion about something,
                    mention the author. Quote if appropriate.

                    - If you haven't found anything useful, don't make up
                    information or guess - simply say "No relevant information
                    found" in {{language}}.

                    - Do not echo my prompt in your response.

                    - Respond with a JSON object containing a single field:
                    "info".

                    - Write nothing other than the JSON.


                    Example JSON response:


                    {
                      "info": "Write here textual information that would help answer my query. Write as much as you think is necessary, focusing on providing useful information for further processing."
                    }



                    [Web page content]: {{setThread}}.



                    JSON response:
                  isolated: true
                  param: data
                  silent: true
                  label: SOCIAL-MEDIA PROMPT
              type: group
              condition: >-
                {{hostname}} =~
                ^(?:reddit|facebook|twitter|telegram|discord|whatsapp)\.com$
              label: SOCIAL-MEDIA
            - steps:
                - label: SET CONTENT
                  type: calc
                  func: set
                  param: setPageThread
                  format: ''
                  value: '{{page}} {{thread}}'
                - type: js
                  args: setPageThread
                  code: |-
                    // For setPageThread
                    const text = args['setPageThread'];
                    const tokenCount = Math.ceil(text.length / 4);

                    return {
                     chars: text.length,
                     estimatedTokens: tokenCount,
                     estimatedWords: Math.ceil(tokenCount * 0.75)
                    };
                  param: count
                  timeout: 15000
                  onFailure: NOT-SOCIAL-MEDIA PROMPT
                  silent: true
                  label: COUNT
                - type: gpt
                  prompt: >-
                    Act as a professional researcher. 


                    Analyze the given [web page content] and summarize useful
                    information to answer my query: "{{query}}"


                    Instructions:

                    - Imagine you are a Google Search engine, collecting
                    relevant information from various websites to form an answer
                    to my query in {{language}}.

                    - Focus on providing detailed factual information,
                    statistics, and specific examples when available.

                    - Gather all information that will be useful in answering my
                    question, including context, numbers, dates and concrete
                    details.

                    - Extract as much useful information as possible from the
                    page content.

                    - Avoid general phrases.

                    - When referring to someone's opinion about something,
                    mention the author. Quote if appropriate.

                    - If you haven't found anything useful, don't make up
                    information or guess - simply say "No relevant information
                    found" in {{language}}.

                    - Do not echo my prompt in your response.

                    - Respond with a JSON object containing a single field:
                    "info".

                    - Write nothing other than the JSON.


                    Example JSON response:


                    {
                      "info": "Write here textual information that would help answer my query. Write as much as you think is necessary, focusing on providing useful information for further processing."
                    }



                    [Web page content]: {{setPageThread}}.



                    JSON response:
                  isolated: true
                  param: data
                  silent: true
                  label: NOT-SOCIAL-MEDIA PROMPT
              type: group
              label: NOT-SOCIAL-MEDIA
              condition: >-
                {{hostname}} =~
                ^(?!(?:reddit|facebook|twitter|telegram|discord|whatsapp)\.com)[a-zA-Z0-9-]+\.[a-zA-Z]+$
            - type: calc
              func: extract-json
              to: data
              param: data
              index: first
            - type: calc
              func: set
              param: data.url
              format: auto
              value: '{{item.url}}'
            - type: calc
              func: set
              param: data.title
              format: auto
              value: '{{item.title}}'
            - type: calc
              func: list-add
              index: last
              list: array
              item: data
          type: group
          label: NOT FETCHED
        - type: say
          message: |-
            ๐Ÿ” Analyzed **{{index}} / {{total}}**,  [{{hostname}}]({{pageUrl}})
            - Chars: {{count.chars}}
            - Estimated Tokens: {{count.estimatedTokens}}
            - Estimated Words: {{count.estimatedWords}}
          label: โ›”๏ธSAY STATUS
          condition: '{{index}} = {{total1}}'
        - type: say
          message: |-
            ๐Ÿ” Analyzed **{{percentage}}**,  [{{hostname}}]({{pageUrl}})
            - Chars: {{count.chars}}
            - Estimated Tokens: {{count.estimatedTokens}}
            - Estimated Words: {{count.estimatedWords}}
          label: SAY STATUS
          condition: '{{index}} != {{total}}'
        - type: js
          args: array
          code: |-
            const content = args['array'];
            const stringContent = JSON.stringify(content);

            return {
              chars: stringContent.length,
              estimatedTokens: Math.ceil(stringContent.length / 4),
              estimatedWords: Math.ceil(stringContent.length / 4 * 0.75)
            };
          param: arrayLength
          timeout: 15000
          onFailure: SAY STATUS
          label: ARRAY LENGTH
          silent: true
        - message: |-
            โœ… **{{percentage}}** pages scanned for "**{{query}}**". 

            Last checked page: [{{hostname}}]({{pageUrl}})
            - Chars: {{count.chars}}
            - Estimated Tokens: {{count.estimatedTokens}}
            - Estimated Words: {{count.estimatedWords}}
            - Array Token length: **{{arrayLength.estimatedTokens}}**
          type: say
          label: SAY STATUS
          condition: '{{index}} = {{total}}'
      type: loop
      list: links
  condition: '{{depth}} = 1'
  label: DEPTH = 1
  type: group
- prompt: >-
    Please ignore all previous instructions. I want you to only respond in
    {{language}}.


    You are a Research AI Agent.  


    I would like you create a comprehensive answer to [MY QUESTION], adhering to
    a specific format I provide:

    - Utilize [Information from the Web], provided below.

    - Extract as much useful information as possible from the web search results

    - Integrate insights from multiple web search sources, and ensure inclusion
    of relevant links in a markdown fully rendered format: [โžŠ](URL), [โž‹](URL)
    etc, to each bullet point.

    - Every URL should correspond to only one symbol: โžŠ โž‹ โžŒ โž โžŽ โž โž โž‘ โž’ โž“.

    - If multiple sources repeat the same information, describe it and cite all
    sources at once. 

    - If you know the answer, add your own knowledge to make it more complete.

    - Do not hallucinate facts or information.

    - Do not use any other tools.

    - Avoid general phrases and be more specific and detailed.


    Follow the [RESPONSE FORMAT]:


    ## Key takeaway:

    Provide a single, most important takeaway from the web search results in
    {{language}}.


    ## Detailed answer:

    Analyze and present detailed information that helps answer my question.
    There should be no limit in words or bullet points to the report. Ensure
    that all ideas, facts, and relevant information are concisely reported, and
    the answer is comprehensive. Incorporate the maximum number of source links
    within the text.



    [MY QUESTION]: {{userQuery}}



    [Information from the Web]:

    {{array}}



    [COMPREHENSIVE RESPONSE WITH SOURCE LINKS ([โžŠ](URL))]:
  type: gpt
  isolated: true
  param: gpt
  dumb: false
  label: FINAL ANSWER
Notice: Please read before using

This automation command is created by a community member. HARPA AI team does not audit community commands.

Please review the command carefully and only install if you trust the creator.

Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service
CAN WE STORE COOKIES?
Our website uses cookies for the purposes of accessibility and security. They also allow us to gather statistics in order to improve the website for you. More info: Privacy Policy